#include "stm32f10x.h"                  // Device header
#include "key.h"
#include "led.h"
#include "Delay.h"
#include "OLED.h"

int main(void)
{
	OLED_Init();
	Led_init();
	Key_init();

	uint8_t pressed = 0;
	uint8_t count = 0;
	
	OLED_ShowString(1, 1, "Hello, World!");
	OLED_ShowString(2, 1, "CNT:");
	OLED_ShowNum(2, 5, count, 4);
	
	while(1) {
		pressed = Key_getNum();
		if (pressed == 1) {
			count ++;
			OLED_ShowNum(2, 5, count, 4);
			led1_turn();
			led2_turn();
		}
	}
}
